import Request from "./request.js";
const API = {
	serviceOrderList: "/app/bus/order/service/list",
	serviceOrderDetails: '/app/bus/order/service/info',
	serviceOrderReceiving: '/app/bus/order/service/receiving',
	serviceOrderAdvance:'/app/bus/order/service/advance',
	serviceOrderReach:'/app/bus/order/service/reach',
	serviceOrderEnd:'/app/bus/order/service/end'
};

// 查询服务者订单列表
export const ServiceOrderList = (params) => Request.get(API.serviceOrderList, {
	data: params
});

// 查询服务者订单详情
export const orderDetail = (orderId) => Request.get(`${API.serviceOrderDetails}/${orderId}`);

// 接单或拒绝订单
export const receiveOrder = (params) => {
    return Request.put(API.serviceOrderReceiving, params);
};

// 预约
export const advanceOrder = (params) => {
    return Request.put(API.serviceOrderAdvance, params);
};
// 到达
export const reachOrder = (params) => {
    return Request.put(API.serviceOrderReach, params);
};
// 结束
export const endOrder = (params) => {
    return Request.put(API.serviceOrderEnd, params);
};